home *** CD-ROM | disk | FTP | other *** search
/ SuperHack / SuperHack CD.bin / CODING / CPP / WCLASS95.ZIP / BC4HEAD.SCT < prev    next >
Encoding:
Text File  |  1995-07-27  |  6.3 KB  |  154 lines

  1. NO_OUTPUT_BEGIN
  2. For Borland C++ 4.X.  Enter include file names in the include box in With Class, e.g. cstring.h for string
  3. class.  For 1 : Many relationships enter classlib\listimp.h in the include box for TListImp <XXX> class.  XXX
  4. represents the class names of the objects in the collection, e.g. Passenger.  If desired change TListImp in this
  5. script with TArray with classlib\arrays.h, TStack with classlib\stacks.h, TBag with classlib\bags.h.
  6. NO_OUTPUT_END
  7.  
  8. // Class: CLASS_NAME                  //Borland C++ 4.X
  9.  
  10. #ifndef __$CAPITALIZE_ALL$TRUNCATE_EIGHT$CLASS_NAME$_H  //Required for current class
  11.   #define __$CAPITALIZE_ALL$TRUNCATE_EIGHT$CLASS_NAME$_H
  12.  
  13. #ifndef __IOSTREAM_H            //Required for cin and cout
  14.   #include <iostream.h>                 
  15. #endif
  16.  
  17. [                               //Required for base classes
  18. #ifndef __$CAPITALIZE_ALL$TRUNCATE_EIGHT$BASE_CLASS$_H
  19.   #include "TRUNCATE_EIGHT$BASE_CLASS$.h"
  20. #endif
  21. ]                               
  22.                 
  23. [#include <INCLUDE_FILE>//Required for include files,eg <classlib\listimp.h>
  24. ]
  25.  
  26. [                               //Required for 1:1 associated classes
  27. #ifndef __$CAPITALIZE_ALL$TRUNCATE_EIGHT$ASSOCIATION_ONE_CLASS$_H
  28.   #include "TRUNCATE_EIGHT$ASSOCIATION_ONE_CLASS.h"
  29. #endif
  30. ]                                                               
  31.  
  32. [                               //Required for 1:1 aggregation (part) classes
  33. #ifndef __$CAPITALIZE_ALL$TRUNCATE_EIGHT$AGGREGATION_ONE_CLASS$_H
  34.   #include "TRUNCATE_EIGHT$AGGREGATION_ONE_CLASS$.h"
  35. #endif
  36. ]                                                               
  37.  
  38. [                               //Required for 1:M associated classes
  39. #ifndef __$CAPITALIZE_ALL$TRUNCATE_EIGHT$ASSOCIATION_MANY_CLASS$_H
  40.   #include "TRUNCATE_EIGHT$ASSOCIATION_MANY_CLASS$.h"
  41. #endif
  42. ]                                                               
  43.  
  44. [                               //Required for 1:M aggregation (part) classes
  45. #ifndef __$CAPITALIZE_ALL$TRUNCATE_EIGHT$AGGREGATION_MANY_CLASS$_H
  46.   #include "TRUNCATE_EIGHT$AGGREGATION_MANY_CLASS$.h"
  47. #endif
  48. ]
  49.             
  50. class CLASS_NAME[NO_RETURN NO_REPEAT: NO_REPEAT public BASE_CLASS ,DELETE_LAST_SYMBOL] CLASS_LIBRARY_BASE_CLASS      
  51. { [ATTRIBUTE_TYPE ATTRIBUTE_NAME$;]
  52.   [ASSOCIATION_ONE_CLASS$* ASSOCIATION_ONE_NAME$;]
  53.   [AGGREGATION_ONE_CLASS AGGREGATION_ONE_NAME$;]
  54.   [TListImp <ASSOCIATION_MANY_CLASS> ASSOCIATION_MANY_NAME$;]
  55.   [TListImp <AGGREGATION_MANY_CLASS> AGGREGATION_MANY_NAME$;]
  56.  
  57. public:
  58.             //Default constructor
  59.             //Update to access base class attributes 
  60.             //Update to access 1:1 part class attributes 
  61.             //Update to access 1:M part class attributes
  62.             //Update to access 1:1 associated class attributes
  63.             //Update to access 1:M associated class attributes
  64.             //Ensure initial values entered
  65.   CLASS_NAME () :[NO_RETURN ATTRIBUTE_NAME(ATTRIBUTE_INITIAL_VALUE),DELETE_LAST_SYMBOL]  { } 
  66.  
  67.             //Constructor with arguments
  68.   CLASS_NAME ([NO_RETURN ATTRIBUTE_TYPE a$ATTRIBUTE_NAME,DELETE_LAST_SYMBOL] )       
  69.   : [NO_RETURN ATTRIBUTE_NAME (a$ATTRIBUTE_NAME),DELETE_LAST_SYMBOL] { }        
  70.             
  71.   
  72.             //Copy constructor
  73.             //Update to access 1:M part class attributes
  74.             //Update to access 1:1 associated class attributes
  75.             //Update to access 1:M associated class attributes      
  76.   CLASS_NAME (const CLASS_NAME$& a$CLASS_NAME ) [NO_RETURN NO_REPEAT: BASE_CLASS (a$CLASS_NAME),DELETE_LAST_SYMBOL]
  77.   { [  ATTRIBUTE_NAME = a$CLASS_NAME$.$ATTRIBUTE_NAME;]
  78.     [AGGREGATION_ONE_NAME = a$CLASS_NAME$.$AGGREGATION_ONE_NAME;]            
  79.   }                                     
  80.  
  81.             //Operator= Assignment Operator
  82.             //Update to access 1:M part class attributes
  83.             //Update to access 1:1 associated class attributes
  84.             //Update to access 1:M associated class attributes      
  85.   CLASS_NAME operator= (const CLASS_NAME$& a$CLASS_NAME)
  86.   { if (this == &a$CLASS_NAME) return *this;          
  87.   [BASE_CLASS$::operator= (a$CLASS_NAME);]
  88.   [ATTRIBUTE_NAME = a$CLASS_NAME$.$ATTRIBUTE_NAME;]
  89.   [AGGREGATION_ONE_NAME = a$CLASS_NAME$.$AGGREGATION_ONE_NAME;]      
  90.   return *this;                                                                                                 
  91.   }                                     
  92.  
  93.             //Operator== Equality Operator
  94.             //Update to access 1:M part class attributes
  95.             //Update to access 1:1 associated class attributes
  96.             //Update to access 1:M associated class attributes      
  97.   int operator== (const CLASS_NAME$& a$CLASS_NAME)
  98.   { return (
  99. [  (BASE_CLASS$::operator== (a$CLASS_NAME)) &&]
  100. [  (AGGREGATION_ONE_NAME == a$CLASS_NAME$.$AGGREGATION_ONE_NAME) &&]
  101. [  (ATTRIBUTE_NAME == a$CLASS_NAME$.ATTRIBUTE_NAME) &DELETE_LAST_SYMBOL&DELETE_LAST_SYMBOL]
  102.   );
  103.   }                             
  104.     
  105.             //Operator<< for cout 
  106.   friend ostream& operator<< (ostream& os, CLASS_NAME$& a$CLASS_NAME);
  107.  
  108.             //Operator<< for cin
  109.   friend istream& operator>> (istream& is, CLASS_NAME$& a$CLASS_NAME);
  110.                 
  111.             
  112. [                       //Get accessor function for attribute
  113.   ATTRIBUTE_TYPE get$ATTRIBUTE_NAME$() const
  114.   {return ATTRIBUTE_NAME$;
  115.   }
  116. ]                       
  117.             
  118. [                       //Set accessor function for attribute
  119.   void set$ATTRIBUTE_NAME ($ATTRIBUTE_TYPE a$ATTRIBUTE_NAME$)
  120.   { ATTRIBUTE_NAME = a$ATTRIBUTE_NAME$;
  121.   }
  122. ]                       
  123.  
  124. [                       //Get accessor function for 1:1 aggregation
  125.   AGGREGATION_ONE_CLASS$& get$AGGREGATION_ONE_NAME$() 
  126.   {return AGGREGATION_ONE_NAME$;
  127.   }
  128. ]                       
  129.             
  130. [                       //Set accessor function for 1:1 aggregation
  131.   void set$AGGREGATION_ONE_NAME ($AGGREGATION_ONE_CLASS$& a$AGGREGATION_ONE_NAME$)
  132.   { AGGREGATION_ONE_NAME = a$AGGREGATION_ONE_NAME$;
  133.   }
  134. ]                       
  135.  
  136. [                       //Get accessor function for 1:1 association
  137.   ASSOCIATION_ONE_CLASS$* get$ASSOCIATION_ONE_NAME$() const
  138.   {return ASSOCIATION_ONE_NAME$;
  139.   }
  140. ]                       
  141.             
  142. [                       //Set accessor function for 1:1 association
  143.   void set$ASSOCIATION_ONE_NAME ($ASSOCIATION_ONE_CLASS$* a$ASSOCIATION_ONE_NAME$)
  144.   { ASSOCIATION_ONE_NAME = a$ASSOCIATION_ONE_NAME$;
  145.   }
  146. ]
  147.         
  148. [  CPP_OPERATION_VIRTUAL CPP_OPERATION_STATIC OPERATION_RETURN_TYPE OPERATION_NAME (CPP_OPERATION_PARAMETERS) CPP_OPERATION_CONSTANT CPP_OPERATION_PURE_VIRTUAL;
  149.  
  150.   OPERATION_CPP_VIRTUAL_BASE_CLASS ~ CLASS_NAME ( ) { }       //Destructor
  151. };
  152.  
  153. #endif